package com.fy.module.exam.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fy.common.vo.ApiRest;
import com.fy.module.exam.dto.ExamSaveDto;
import com.fy.module.exam.entity.ExamDepart;
import com.fy.module.exam.service.IExamDepartService;
import com.fy.module.exam.service.IExamService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 * 考试部门 前端控制器
 * </p>
 *
 * @author yang
 * @since 2023-03-22
 */
@RestController
@RequestMapping("/exam/depart")
@CrossOrigin
public class ExamDepartController {

    @Autowired
    private IExamDepartService examDepartService;

    @GetMapping("/list")
    @PreAuthorize("hasAnyRole('ROLE_ADMIN','ROLE_COMMON')")
    @ApiModelProperty("添加考试宗卷")
    public ApiRest listExamDeparts(){
        List<ExamDepart> list = examDepartService.list();
        return ApiRest.success(list);
    }
}
